package com.tanhua.dubbo.api;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.tanhua.dubbo.api.db.ReportApi;
import com.tanhua.dubbo.api.mapper.ReportMapper;
import com.tanhua.model.db.Report;
import org.apache.dubbo.config.annotation.DubboService;
import org.springframework.beans.factory.annotation.Autowired;

/**
 * @Classname ReportApiImpl
 * @Description
 * @Version 1.0.0
 * @Date 2021/12/28 10:48
 * @Created by zk
 */
@DubboService
public class ReportApiImpl implements ReportApi {

    @Autowired
    private ReportMapper reportMapper;

    /**
     * 根据报告id查询报告表
     * @param reportId
     * @return
     */
    @Override
    public Report queryByReportId(String reportId) {
        QueryWrapper<Report> queryWrapper = new QueryWrapper<>();
        queryWrapper.eq("id", reportId);
        return reportMapper.selectOne(queryWrapper);
    }
}